.class final Lcom/google/android/exoplayer/h;
.super Ljava/lang/Object;
.source "ExoPlayerImpl.java"

# interfaces
.implements Lcom/google/android/exoplayer/g;


# instance fields
.field private final a:Landroid/os/Handler;

.field private final b:Lcom/google/android/exoplayer/i;

.field private final c:Ljava/util/concurrent/CopyOnWriteArraySet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/CopyOnWriteArraySet<",
            "Lcom/google/android/exoplayer/g$c;",
            ">;"
        }
    .end annotation
.end field

.field private final d:[[Lcom/google/android/exoplayer/o;

.field private final e:[I

.field private f:Z

.field private g:I

.field private h:I


# direct methods
.method public constructor <init>(III)V
    .locals 6
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "HandlerLeak"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "ExoPlayerImpl"

    const-string v1, "Init 1.5.5"

    .line 2
    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v0, 0x0

    .line 3
    iput-boolean v0, p0, Lcom/google/android/exoplayer/h;->f:Z

    const/4 v0, 0x1

    .line 4
    iput v0, p0, Lcom/google/android/exoplayer/h;->g:I

    .line 5
    new-instance v0, Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;-><init>()V

    iput-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    .line 6
    new-array v0, p1, [[Lcom/google/android/exoplayer/o;

    iput-object v0, p0, Lcom/google/android/exoplayer/h;->d:[[Lcom/google/android/exoplayer/o;

    .line 7
    new-array p1, p1, [I

    iput-object p1, p0, Lcom/google/android/exoplayer/h;->e:[I

    .line 8
    new-instance v1, Lcom/google/android/exoplayer/h$a;

    invoke-direct {v1, p0}, Lcom/google/android/exoplayer/h$a;-><init>(Lcom/google/android/exoplayer/h;)V

    iput-object v1, p0, Lcom/google/android/exoplayer/h;->a:Landroid/os/Handler;

    .line 9
    new-instance p1, Lcom/google/android/exoplayer/i;

    iget-boolean v2, p0, Lcom/google/android/exoplayer/h;->f:Z

    iget-object v3, p0, Lcom/google/android/exoplayer/h;->e:[I

    move-object v0, p1

    move v4, p2

    move v5, p3

    invoke-direct/range {v0 .. v5}, Lcom/google/android/exoplayer/i;-><init>(Landroid/os/Handler;Z[III)V

    iput-object p1, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    return-void
.end method


# virtual methods
.method public a()I
    .locals 9

    .line 16
    invoke-virtual {p0}, Lcom/google/android/exoplayer/h;->e()J

    move-result-wide v0

    .line 17
    invoke-virtual {p0}, Lcom/google/android/exoplayer/h;->getDuration()J

    move-result-wide v2

    const-wide/16 v4, -0x1

    cmp-long v6, v0, v4

    if-eqz v6, :cond_2

    cmp-long v6, v2, v4

    if-nez v6, :cond_0

    goto :goto_1

    :cond_0
    const-wide/16 v4, 0x0

    const-wide/16 v6, 0x64

    cmp-long v8, v2, v4

    if-nez v8, :cond_1

    goto :goto_0

    :cond_1
    mul-long v0, v0, v6

    .line 18
    div-long v6, v0, v2

    :goto_0
    long-to-int v0, v6

    goto :goto_2

    :cond_2
    :goto_1
    const/4 v0, 0x0

    :goto_2
    return v0
.end method

.method public a(I)I
    .locals 1

    .line 7
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->e:[I

    aget p1, v0, p1

    return p1
.end method

.method public a(F)V
    .locals 1

    .line 19
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1}, Lcom/google/android/exoplayer/i;->a(F)V

    return-void
.end method

.method public a(II)V
    .locals 2

    .line 4
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->e:[I

    aget v1, v0, p1

    if-eq v1, p2, :cond_0

    .line 5
    aput p2, v0, p1

    .line 6
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1, p2}, Lcom/google/android/exoplayer/i;->a(II)V

    :cond_0
    return-void
.end method

.method public a(JZ)V
    .locals 1

    .line 14
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1, p2, p3}, Lcom/google/android/exoplayer/i;->a(JZ)V

    return-void
.end method

.method a(Landroid/os/Message;)V
    .locals 6

    .line 20
    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_4

    const/4 v2, 0x2

    if-eq v0, v2, :cond_3

    const/4 v2, 0x3

    if-eq v0, v2, :cond_2

    const/4 v1, 0x4

    if-eq v0, v1, :cond_1

    const/4 v1, 0x5

    if-eq v0, v1, :cond_0

    goto/16 :goto_5

    .line 21
    :cond_0
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/exoplayer/g$c;

    .line 22
    iget-object v2, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v2, Ljava/lang/Long;

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    const-wide/16 v4, 0x3e8

    div-long/2addr v2, v4

    invoke-interface {v1, v2, v3}, Lcom/google/android/exoplayer/g$c;->a(J)V

    goto :goto_0

    .line 23
    :cond_1
    iget-object p1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast p1, Lcom/google/android/exoplayer/ExoPlaybackException;

    .line 24
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/exoplayer/g$c;

    .line 25
    invoke-interface {v1, p1}, Lcom/google/android/exoplayer/g$c;->a(Lcom/google/android/exoplayer/ExoPlaybackException;)V

    goto :goto_1

    .line 26
    :cond_2
    iget p1, p0, Lcom/google/android/exoplayer/h;->h:I

    sub-int/2addr p1, v1

    iput p1, p0, Lcom/google/android/exoplayer/h;->h:I

    if-nez p1, :cond_5

    .line 27
    iget-object p1, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {p1}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_2
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_5

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/exoplayer/g$c;

    .line 28
    invoke-interface {v0}, Lcom/google/android/exoplayer/g$c;->a()V

    goto :goto_2

    .line 29
    :cond_3
    iget v0, p1, Landroid/os/Message;->arg1:I

    iput v0, p0, Lcom/google/android/exoplayer/h;->g:I

    .line 30
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_3
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/exoplayer/g$c;

    .line 31
    iget-boolean v2, p0, Lcom/google/android/exoplayer/h;->f:Z

    iget v3, p0, Lcom/google/android/exoplayer/h;->g:I

    iget v4, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v1, v2, v3, v4}, Lcom/google/android/exoplayer/g$c;->a(ZII)V

    goto :goto_3

    .line 32
    :cond_4
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    iget-object v1, p0, Lcom/google/android/exoplayer/h;->d:[[Lcom/google/android/exoplayer/o;

    array-length v2, v1

    const/4 v3, 0x0

    invoke-static {v0, v3, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 33
    iget v0, p1, Landroid/os/Message;->arg1:I

    iput v0, p0, Lcom/google/android/exoplayer/h;->g:I

    .line 34
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_4
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/exoplayer/g$c;

    .line 35
    iget-boolean v2, p0, Lcom/google/android/exoplayer/h;->f:Z

    iget v3, p0, Lcom/google/android/exoplayer/h;->g:I

    iget v4, p1, Landroid/os/Message;->arg2:I

    invoke-interface {v1, v2, v3, v4}, Lcom/google/android/exoplayer/g$c;->a(ZII)V

    goto :goto_4

    :cond_5
    :goto_5
    return-void
.end method

.method public a(Lcom/google/android/exoplayer/g$a;ILjava/lang/Object;)V
    .locals 1

    .line 15
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1, p2, p3}, Lcom/google/android/exoplayer/i;->a(Lcom/google/android/exoplayer/g$a;ILjava/lang/Object;)V

    return-void
.end method

.method public a(Lcom/google/android/exoplayer/g$c;)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0, p1}, Ljava/util/concurrent/CopyOnWriteArraySet;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public a(Z)V
    .locals 4

    .line 8
    iget-boolean v0, p0, Lcom/google/android/exoplayer/h;->f:Z

    if-eq v0, p1, :cond_0

    .line 9
    iput-boolean p1, p0, Lcom/google/android/exoplayer/h;->f:Z

    .line 10
    iget v0, p0, Lcom/google/android/exoplayer/h;->h:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/google/android/exoplayer/h;->h:I

    .line 11
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1}, Lcom/google/android/exoplayer/i;->a(Z)V

    .line 12
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->c:Ljava/util/concurrent/CopyOnWriteArraySet;

    invoke-virtual {v0}, Ljava/util/concurrent/CopyOnWriteArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/exoplayer/g$c;

    .line 13
    iget v2, p0, Lcom/google/android/exoplayer/h;->g:I

    const/4 v3, 0x0

    invoke-interface {v1, p1, v2, v3}, Lcom/google/android/exoplayer/g$c;->a(ZII)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public varargs a([Lcom/google/android/exoplayer/u;)V
    .locals 2

    .line 2
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->d:[[Lcom/google/android/exoplayer/o;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Ljava/util/Arrays;->fill([Ljava/lang/Object;Ljava/lang/Object;)V

    .line 3
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1}, Lcom/google/android/exoplayer/i;->a([Lcom/google/android/exoplayer/u;)V

    return-void
.end method

.method public b()V
    .locals 1

    .line 2
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->a()V

    return-void
.end method

.method public b(Lcom/google/android/exoplayer/g$a;ILjava/lang/Object;)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0, p1, p2, p3}, Lcom/google/android/exoplayer/i;->b(Lcom/google/android/exoplayer/g$a;ILjava/lang/Object;)V

    return-void
.end method

.method public c()Z
    .locals 1

    .line 1
    iget-boolean v0, p0, Lcom/google/android/exoplayer/h;->f:Z

    return v0
.end method

.method public d()J
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->e()J

    move-result-wide v0

    return-wide v0
.end method

.method public e()J
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->b()J

    move-result-wide v0

    return-wide v0
.end method

.method public getCurrentPosition()J
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->c()J

    move-result-wide v0

    return-wide v0
.end method

.method public getDuration()J
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->d()J

    move-result-wide v0

    return-wide v0
.end method

.method public getPlaybackState()I
    .locals 1

    .line 1
    iget v0, p0, Lcom/google/android/exoplayer/h;->g:I

    return v0
.end method

.method public release()V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->f()V

    .line 2
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->a:Landroid/os/Handler;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V

    return-void
.end method

.method public stop()V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/google/android/exoplayer/h;->b:Lcom/google/android/exoplayer/i;

    invoke-virtual {v0}, Lcom/google/android/exoplayer/i;->g()V

    return-void
.end method
